/**
    Copyright (C) 2011  Alexander Vollmer

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.jefb.sec.entity;

public enum UserRight {

	ALL,

	// file manager permissions
	DELETE_FILE, DOWNLOAD_FILE, UPLOAD_FILE, VIEW_FILE, EDIT_FILE, RENAME_FILE, CREATE_NEW_FOLDER, CREATE_NEW_FILE, MOVE_FILE,
	ZIP_FILE,
	
	// role manager permissions
	VIEW_ROLES, CREATE_ROLE, EDIT_ROLE, DELETE_ROLE,
	
	//user manager permissions
	VIEW_USERS, CREATE_USER, EDIT_USER, DELETE_USER,

	VIEW_WORKSPACE,
	// VIEW_INBOX,
	// VIEW_OUTBOX,
	// VIEW_ARCHIVE,
	// VIEW_SYNC,

	// VIEW_COMMON_WORKSPACE,
	// VIEW_COMMON_INBOX,
	// VIEW_COMMON_OUTBOX,
	// VIEW_COMMON_ARCHIVE,
	// VIEW_COMMON_SYNC,
	// VIEW_COMMON_PUSH,
	VIEW_COMMON_BASE,

	VIEW_DESTINATIONS, VIEW_ACTION_LOG, VIEW_SETTINGS, VIEW_APP_MONITOR;

	/**
	 * 
	 */
	public static boolean valid(String right) {
		try {
			valueOf(right);
		} catch (IllegalArgumentException iae) {
			return false;
		}
		return true;
	}

	public static void main(String[] args) {
		System.out.println(UserRight.valid("ALL"));
	}

}
